package com.intelligentclass.repositories;

import com.intelligentclass.entity.Syllabus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface SyllabusRespository extends JpaRepository<Syllabus, Integer> {

    @Query("select s.name from Syllabus s where s.cid = :cid")
    public String getNameByCid(@Param("cid") int cid);

    @Query("select s from Syllabus s where s.cid = :cid and s.name = :name")
    public Syllabus getByCidAndName(@Param("cid") int cid, @Param("name") String name);

    @Query("select s from Syllabus s where s.cid = :cid")
    public Syllabus getByCid(@Param("cid") int cid);
}
